package com.biz.primus.model.sso.auth.vo;

import com.biz.primus.base.enums.CommonStatus;

import java.io.Serializable;

/**
 * Created by younger on 17/11/3.
 */
public abstract class AbstractDescribableItem implements Serializable, IDescribableItem {
    private static final long serialVersionUID = -4234610136427573150L;

    private String customId;

    private String name;

    private String description;

    private Integer orderIndex;

    private CommonStatus status;



    protected AbstractDescribableItem() {
    }

    protected AbstractDescribableItem(String customId, String name, String description, Integer orderIndex, CommonStatus status) {
        this.customId = customId;
        this.name = name;
        this.description = description;
        this.orderIndex = orderIndex;
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AbstractDescribableItem that = (AbstractDescribableItem) o;

        return customId != null ? customId.equals(that.customId) : that.customId == null;
    }

    @Override
    public int hashCode() {
        return customId != null ? customId.hashCode() : 0;
    }

    /**
     * {@linkplain AbstractDescribableItem#customId}
     */
    public String getCustomId() {
        return customId;
    }

    /**
     * {@linkplain AbstractDescribableItem#customId}
     */
    public void setCustomId(String customId) {
        this.customId = customId;
    }

    /**
     * {@linkplain AbstractDescribableItem#name}
     */
    public String getName() {
        return name;
    }

    /**
     * {@linkplain AbstractDescribableItem#name}
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * {@linkplain AbstractDescribableItem#description}
     */
    public String getDescription() {
        return description;
    }

    /**
     * {@linkplain AbstractDescribableItem#description}
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * {@linkplain AbstractDescribableItem#orderIndex}
     */
    @Override
    public Integer getOrderIndex() {
        return orderIndex;
    }

    /**
     * {@linkplain AbstractDescribableItem#orderIndex}
     */
    @Override
    public void setOrderIndex(Integer orderIndex) {
        this.orderIndex = orderIndex;
    }

    /**
     * {@linkplain AbstractDescribableItem#status}
     */
    public CommonStatus getStatus() {
        return status;
    }

    /**
     * {@linkplain AbstractDescribableItem#status}
     */
    public void setStatus(CommonStatus status) {
        this.status = status;
    }
}
